<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateBackendAttachmentsTable extends Migration
{
    /**
     * Run the migrations.
     * 创建后台附件管理
     * @return void
     */
    public function up()
    {
        Schema::create('backend_attachments', function (Blueprint $table) {
            $table->id();
            $table->string('filename')->nullable()->comment('文件名');
            $table->string('filesize')->comment('文件大小');
            $table->string('filetype')->comment('文件类型');
            $table->string('mimetype')->comment('Mine类型');
            $table->text('url')->comment('文件地址');
            $table->string('local_path')->comment('本地储存位置');
            $table->string('sha1')->comment('文件sha1');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('backend_attachments');
    }
}
